*************************************************************************
*																		*
*					Code Political involvement								*
*																		*
**************************************************************************

/* 
Replication Material for:
Maria Preißinger & Harald Schoen (2016): It's not always the campaign - 
Explaining inter-elction switching in Germany, 2009-2013. Electoral Studies.

Date: Sep 2016
*/



*-------------------------------
* Political interest
*-------------------------------

lab define int ///
	0 "none" ///
	1 "very high"	

** 2009
foreach welle in 2 4 6 7 {
gen a_poli`welle' = a_kp`welle'_010 
recode a_poli`welle' (4=2) (5=1) (2=4) (1=5) (99=.)
replace a_poli`welle' = (a_poli`welle'-1)/4
lab var a_poli`welle' "Political interest"
lab val a_poli`welle' int
}


fre a_poli2



** 2013
foreach welle of numlist 1/7 {
gen b_poli`welle' = b_kp`welle'_010 
recode b_poli`welle' (4=2) (5=1) (2=4) (1=5) (-99=.) (-95=.) (-93=.)
replace b_poli`welle' = (b_poli`welle'-1)/4
lab var b_poli`welle' "Political interest"
lab val b_poli`welle' int
}


fre b_poli2


* Categoroze political interest in three categories
foreach year in a b {
foreach num of numlist 1/7 {
capture recode `year'_poli`num' (0 0.25=-1) (0.5=0) (0.75 1=1), gen(`year'_polikat`num')
}
}



// in a_poli2 870 people are missing: fill in their political interest
//from wave 4									
											
gen a_polikatnew = a_polikat2
replace a_polikatnew = -1 if a_polikat2==. & (a_kp4_010==5 | a_kp4_010==4)
replace a_polikatnew = 0 if a_polikat2==. & a_kp4_010==3
replace a_polikatnew = 1 if a_polikat2==. & (a_kp4_010==1 | a_kp4_010==2)



*------------------------------------------------
* Party Identification
*-------------------------------------------

* indentify Independents: if respondent started survey in wave 2, assign value from wave 3, 
* otherwise value from wave 1

gen a_newpidno1 = 0 
replace a_newpidno1 = 1 if a_kp1_2090a==808 | (a_w1==0 & a_kp3_2090a==808)
replace a_newpidno1 = . if (a_w1==0 & a_kp3_2090a>808) | (a_w1==1 & a_kp1_2090a>808)


*------------------------------
* Data hygiene
*---------------------------------

drop b_poli? ?_polikat?
